package basic.demo.array;

public class ArrayStudy3 {

    /**
     * 不等长二维数组演示
     * @param args
     */
    public static void main(String[] args) {
        int[][] arr = new int[3][];
        arr[0] = new int[1];
        arr[1] = new int[2];
        arr[2] = new int[3];
        arr[0][0] = 1;
        System.out.println(arr[0][0]);

        // arr[0][1] = 2; 越界，会报错
        arr[1][0] = 10;
        arr[1][1] = 20;

        System.out.println(arr[1][0]+" "+arr[1][1]);


        arr[2][0] = 100;
        arr[2][1] = 200;
        arr[2][2] = 300;
        System.out.println(arr[2][0]+" "+arr[2][1]+" "+arr[2][2]);





    }


}
